export default function(obj){
    let result = [];
    if(is(obj).toLowerCase() === 'object'){
        Object.keys(obj).forEach(key => {
            result.push(encodeURIComponent(key)+ '=' + encodeURIComponent(obj[key]));
        });
    }
    return result.join('&');
}

/**
 * @note 判断对象类型
 * @return {String}
 * */
function is(obj){
    // [Object Object] || [Object Array]
    return Object.prototype.toString.call(obj).slice(8,-1).toLowerCase();
}
